
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>简介 · docker swarm实践文档</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="Carey">
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-emphasize/plugin.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-alerts/style.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-code/plugin.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search-plus/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="http://carey.akhack.com" target="_blank" class="custom-link">Home</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter active" data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" >
            
                <span>
            
                    
                    基础环境
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="base_book/环境介绍.html">
            
                <a href="base_book/环境介绍.html">
            
                    
                    环境介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="base_book/环境准备.html">
            
                <a href="base_book/环境准备.html">
            
                    
                    基础准备
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="base_book/安装docker.html">
            
                <a href="base_book/安装docker.html">
            
                    
                    安装 docker
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="base_book/compose_file.html">
            
                <a href="base_book/compose_file.html">
            
                    
                    compose file文档
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="base_book/registry仓库管理.html">
            
                <a href="base_book/registry仓库管理.html">
            
                    
                    registry管理
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" >
            
                <span>
            
                    
                    swarm 群集
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="swarm_book/创建群集.html">
            
                <a href="swarm_book/创建群集.html">
            
                    
                    创建群集
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="swarm_book/portainer.html">
            
                <a href="swarm_book/portainer.html">
            
                    
                    swarm管理工具Portainer
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="swarm_book/群集监控.html">
            
                <a href="swarm_book/群集监控.html">
            
                    
                    cAdvisor InfluxDB Grafana搭建监控平台
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="swarm_book/telegraf.html">
            
                <a href="swarm_book/telegraf.html">
            
                    
                    Telegraf监控容器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="swarm_book/Chronograf.html">
            
                <a href="swarm_book/Chronograf.html">
            
                    
                    Chronograf显示监控数据
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" >
            
                <span>
            
                    
                    swarm service
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="service_book/nginx.html">
            
                <a href="service_book/nginx.html">
            
                    
                    部署nginx服务
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" >
            
                <span>
            
                    
                    swarm stack
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="swarm_stack/lnmpwordpress.html">
            
                <a href="swarm_stack/lnmpwordpress.html">
            
                    
                    部署wordpress
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="swarm_stack/build_eureka.md">
            
                <span>
            
                    
                    部署eureka
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >简介</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div class="search-plus" id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x7B80;&#x4ECB;">&#x7B80;&#x4ECB;</h1>
<p>2017&#x5E74;1&#x6708;&#x53D1;&#x5E03;&#x7684; Docker <strong>1.13</strong>&#x7248;&#x672C;&#x4E2D;&#xFF0C;Swarm mode&#x8FC5;&#x901F;&#x6210;&#x719F;&#xFF0C;&#x76F8;&#x5E94;&#x7684;&#x5DE5;&#x5177;&#x652F;&#x6301;&#x4E5F;&#x8FDB;&#x4E00;&#x6B65;&#x5B8C;&#x5584;&#x3002; Docker <a href="https://docs.docker.com/compose/compose-file/" target="_blank">Compose v3</a> &#x89C4;&#x8303;&#xFF0C;&#x5DF2;&#x7ECF;&#x5168;&#x9762;&#x652F;&#x6301; Swarm mode &#x6982;&#x5FF5;&#x3002;&#x800C;&#x4E14;&#x4ECE; 1.13 &#x5F00;&#x59CB;&#xFF0C;Docker &#x547D;&#x4EE4;&#x884C;&#x5DE5;&#x5177;&#x652F;&#x6301;&#x76F4;&#x63A5;&#x4F7F;&#x7528; <code>v3</code> &#x7248;&#x672C;&#x7684; <code>docker-compose.yml</code> &#x6587;&#x4EF6;&#x6765;&#x8FDB;&#x884C;&#x5E94;&#x7528;&#x6808;<code>(stack)</code>&#x90E8;&#x7F72;&#x7BA1;&#x7406;&#xFF0C;&#x8FD9;&#x5927;&#x5927;&#x7B80;&#x5316;&#x4E86;&#x5BB9;&#x5668;&#x7F16;&#x6392;&#x4F7F;&#x7528;&#x7684;&#x590D;&#x6742;&#x6027;&#x3002;</p>
<p>Docker &#x5B98;&#x7F51;&#x7684;&#x8FD9;&#x5F20;&#x56FE;&#x7247;&#x5F62;&#x8C61;&#x7684;&#x5C55;&#x793A;&#x4E86;&#x96C6;&#x7FA4;&#x4E2D;&#x7BA1;&#x7406;&#x8282;&#x70B9;&#x4E0E;&#x5DE5;&#x4F5C;&#x8282;&#x70B9;&#x7684;&#x5173;&#x7CFB;&#x3002;
<img src="https://carey-akhack-com.oss-cn-hangzhou.aliyuncs.com/book/swarm/swarm-diagram.png" alt=""></p>
<h1 id="swarm-v2-&#x7279;&#x6027;">swarm v2 &#x7279;&#x6027;</h1>
<ul>
<li>&#x4ECE;1.12&#x7248;&#x672C;&#x5F00;&#x59CB;&#xFF0C;swarm V2&#x5185;&#x5D4C;&#x5230;&#x4E86;Docker Engine&#x91CC;</li>
<li>&#x4F7F;&#x7528;&#x53BB;&#x4E2D;&#x5FC3;&#x5316;&#x7684;&#x673A;&#x5236;&#x6765;&#x6784;&#x5EFA;&#x9009;&#x4E3B;&#x673A;&#x5236;&#xFF0C;&#x5185;&#x90E8;&#x96C6;&#x6210;&#x4E86;Etcd&#xFF0C;&#x8FD9;&#x662F;Raft&#x516C;&#x5F0F;&#x7B97;&#x6CD5;&#x7684;&#x4E00;&#x79CD;&#x5B9E;&#x73B0;</li>
<li>&#x57FA;&#x7840;&#x548C;&#x9AD8;&#x7EA7;&#x8C03;&#x5EA6;&#x9009;&#x9879;&#x3002;schedule&#xFF08;&#x8C03;&#x5EA6;&#x5668;&#xFF09;&#x662F;&#x4E00;&#x79CD;&#x51B3;&#x5B9A;&#x5BB9;&#x5668;&#x7269;&#x7406;&#x4E0A;&#x653E;&#x7F6E;&#x7684;&#x4E3B;&#x673A;&#x7684;&#x7B97;&#x6CD5;</li>
<li>Constraint&#xFF08;&#x7EA6;&#x675F;&#x6761;&#x4EF6;&#xFF09;&#x548C;affinity&#xFF08;&#x5171;&#x540C;&#x5173;&#x7CFB;&#xFF09;&#x53EF;&#x4EE5;&#x505A;&#x51FA;&#x8C03;&#x5EA6;&#x51B3;&#x7B56;&#x3002;&#x4F7F;&#x7528;docker swarm lable&#xFF08;&#x6807;&#x7B7E;&#xFF09;</li>
<li>&#x4F7F;&#x7528;&#x5185;&#x5EFA;DNS Round-Robin&#x5B9E;&#x73B0;&#x7FA4;&#x96C6;&#x5185;&#x7684;&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#xFF0C;&#x4E5F;&#x652F;&#x6301;&#x5916;&#x90E8;&#x8D1F;&#x8F7D;&#x5747;&#x8861;&#xFF0C;&#x901A;&#x8FC7;&#x8DEF;&#x7531;&#x7F51;&#x683C;&#x673A;&#x5236;&#xFF0C;&#x7531;IPVS&#x5B9E;&#x73B0;</li>
<li>&#x9AD8;&#x53EF;&#x7528;&#x548C;&#x6545;&#x969C;&#x6062;&#x590D;&#x673A;&#x5236;&#xFF0C;&#x81F3;&#x5C11;&#x9700;&#x8981;3&#x4E2A;master</li>
</ul>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"简介","level":"1.1","depth":1,"next":{"title":"基础环境","level":"1.2","depth":1,"ref":"","articles":[{"title":"环境介绍","level":"1.2.1","depth":2,"path":"base_book/环境介绍.md","ref":"base_book/环境介绍.md","articles":[]},{"title":"基础准备","level":"1.2.2","depth":2,"path":"base_book/环境准备.md","ref":"base_book/环境准备.md","articles":[]},{"title":"安装 docker","level":"1.2.3","depth":2,"path":"base_book/安装docker.md","ref":"base_book/安装docker.md","articles":[]},{"title":"compose file文档","level":"1.2.4","depth":2,"path":"base_book/compose_file.md","ref":"base_book/compose_file.md","articles":[]},{"title":"registry管理","level":"1.2.5","depth":2,"path":"base_book/registry仓库管理.md","ref":"base_book/registry仓库管理.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["emphasize","alerts","code","-lunr","-search","search-plus","splitter"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"emphasize":{},"splitter":{},"code":{"copyButtons":true},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"alerts":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"search-plus":{}},"theme":"default","author":"Carey","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"docker swarm实践文档","language":"zh-hans","links":{"sidebar":{"Home":"http://carey.akhack.com"}},"gitbook":"*"},"file":{"path":"README.md","mtime":"2018-07-06T03:01:13.239Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-12-04T03:25:36.834Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-alerts/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-code/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search-plus/jquery.mark.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search-plus/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

